package com.crazy.appium.action;

import java.util.Set;

import com.crazy.appium.driver.CrazyMobileDriver;
import com.crazy.appium.page.HomePage;
import com.crazy.appium.page.MinePage;
import com.crazy.appium.page.PersionCenterPage;
import com.crazy.appium.page.ProductDetailsPage;

/**
 * @author 沙陌  qq2879897713
 *
 */
public class ProductBuy {
	public HomePage homePage;

	public ProductDetailsPage productpage;
	public ProductBuy(CrazyMobileDriver driver,String platform) {
		this.homePage=new HomePage(driver, platform);
		this.productpage=new ProductDetailsPage(driver, platform);
		// TODO Auto-generated constructor stub
	}
	
	public void buyProduct(){
		homePage.clickMenu("首页");
		homePage.clickProduct();
//		Set<String> contexts=homePage.driver.getContexts();
//		for(String s:contexts){
//			System.out.println(s);
//		}
		homePage.driver.switchToContext("WEBVIEW_com.toobei.lcds");
		productpage.clickBuy();
	}
}
